ass Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        int index=0;
        for(auto tmp:nums)
        {
            if(index<2||nums[index-2]!=tmp)
            {
                nums[index++]=tmp;
            }
        }
        return index;

    }
};//
